package com.ning.city.vo;

import lombok.Data;
import lombok.RequiredArgsConstructor;

import java.util.List;

/**
 * @author Ning 242741154@qq.com
 * @date 2021/1/5 11:50
 */
@Data
@RequiredArgsConstructor
public class CommonResult<T> {
    // --- codes ---
    public static final int OK = 200;
    public static final int VALIDATION_ERROR = 430;
    public static final int UN_LOGIN = 441;
    public static final int TOKEN_EXPIRE = 442;
    public static final int TOKEN_ERROR = 443;

    private int code = 200;
    /**
     * 成功时返回的数据集
     */
    private T data;
    /**
     * 错误时返回的错误集
     */
    private List<String> errors;

    public CommonResult(T data) {
        this.data = data;
    }
}
